package com.pony.iphone.utils;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * 统一返回结果状态码
 */
@AllArgsConstructor
@NoArgsConstructor
public enum AppHttpCodeEnum {

    SUCCESS(200, "操作成功"),
    ERROR(400, "操作失败"),
    // 参数错误 500-599
    PARAMETER_LACK(500, "参数缺失"),
    PARAMETER_INVALID(501, "参数错误"),
    IMAGE_ERROR_TYPE(502, "上传文件非图片类型"),
    MP3_ERROR_TYPE(503, "上传文件非MP3类型"),
    FILE_EXCEED(504, "上传文件超出大小"),
    // 认证授权错误 600-699
    AUTHORITY_LACK(600, "您的权限不足"),
    AUTHENTICATION_FAILED(601, "用户认证失败，请重写登录"),
    NEED_LOGIN(602, "需要登录后操作");


    private int code;
    private String message;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


    @Override
    public String toString() {
        return "AppHttpCodeEnum{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}